<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class PayWay extends Model
{
    public function setAlipayImgAttribute($image)
    {
        if (is_array($image)) {
            $this->attributes['alipay_img'] = json_encode($image);
        }
    }

    public function getAlipayImgAttribute($image)
    {
        return json_decode($image, true);
    }

    public function setWxpayImgAttribute($image)
    {
        if (is_array($image)) {
            $this->attributes['wxpay_img'] = json_encode($image);
        }
    }

    public function getWxpayImgAttribute($image)
    {
        return json_decode($image, true);
    }

    public function setTransferImgAttribute($image)
    {
        if (is_array($image)) {
            $this->attributes['transfer_img'] = json_encode($image);
        }
    }

    public function getTransferImgAttribute($image)
    {
        return json_decode($image, true);
    }
}
